﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LNSServer.Models
{
    /// <summary>
    /// 资源库表
    /// </summary>
    [SugarTable("resourcepool", TableDescription = "资源库表")]
    public class ResourcePool
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id", ColumnDescription = "主键ID")]
        public long Id { get; set; }

        /// <summary>
        /// 模型封面图
        /// </summary>
        [SugarColumn(ColumnName = "cover", ColumnDataType = "text", ColumnDescription = "模型封面图")]
        public string Cover { get; set; }

        /// <summary>
        /// 模型名称
        /// </summary>
        [SugarColumn(ColumnName = "title", ColumnDescription = "模型名称")]
        public string Title { get; set; }

        /// <summary>
        /// 模型路径
        /// </summary>
        [SugarColumn(ColumnName = "path", ColumnDataType ="text", ColumnDescription = "模型路径")]
        public string Path { get; set; }

        /// <summary>
        /// 标签ID
        /// </summary>
        //[SugarColumn(ColumnName = "tgid", ColumnDescription = "标签ID")]
        //public long TgId { get; set; }

        /// <summary>
        /// 标签名称
        /// </summary>
        [SugarColumn(ColumnName = "tagname", ColumnDescription = "标签名称")]
        public string TagName { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        [SugarColumn(ColumnName = "uid", ColumnDescription = "用户ID")]
        public long UId { get; set; }

        /// <summary>
        /// 封面图Url
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public User User { get; set; }

        /// <summary>
        /// 是否激活数据 1-是 0-否
        /// </summary>
        [SugarColumn(ColumnName = "isactive", ColumnDescription = "是否激活数据 1-是 0-否")]
        public int IsActive { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "created", IsOnlyIgnoreUpdate = true)]
        public DateTime Created { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>        
        [SugarColumn(ColumnName = "updated")]
        public DateTime Updated { get; set; } = DateTime.Now;

    }
}
